class House():
    def __init__(self,homeType,areaTotal):
        self.homeType = homeType
        self.areaTotal = areaTotal
        self.furnitures = []
    def getRemainingArea(self):
        furnitureArea = 0
        for furniture in self.furnitures:
            furnitureArea += furniture.area
        return self.areaTotal - furnitureArea
    def ShowFurnitureNames(self):
        for furniture in self.furnitures:
           print(furniture.name)
    def addFurniture(self,furniture):
        if furniture.area < self.getRemainingArea():
            self.furnitures.append(furniture)

    def display(self):
        print(f"户型:{self.homeType}")
        print(f"总面积:{self.areaTotal}")
        print(f"剩余面积:{self.getRemainingArea()}")
        print(f"家具名称列表:")
        self.ShowFurnitureNames()
class Furniture():
    def __init__(self,name,area):
        self.name = name
        self.area = area

if __name__ == '__main__':
    myHouse = House("两室一厅",100)
    bed = Furniture("床", 4)
    wardrobe = Furniture("衣柜", 2)
    table = Furniture("餐桌", 1.5)
    myHouse.addFurniture(bed)
    myHouse.addFurniture(wardrobe)
    myHouse.addFurniture(table)
    myHouse.display()
